using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace Cafe
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Chuoi.EncryptDecrypt ed = new Chuoi.EncryptDecrypt();
            Cafe.Class.ClsConnection ketnoi = new Cafe.Class.ClsConnection();
#if(RELEASE)
            if (!global::Cafe.Properties.Settings.Default.registered)
            {
                global::Cafe.Properties.Settings.Default.key_check = ed.EncryptText("ABC-DEF-321-123");
                global::Cafe.Properties.Settings.Default.key = "";
                global::Cafe.Properties.Settings.Default.Save();
            }
#elif(DEBUG)
            //key debug : ABC-DEF-123-321
            global::Cafe.Properties.Settings.Default.key = ed.EncryptText("ABC-DEF-123-321");
            global::Cafe.Properties.Settings.Default.key_check = ed.EncryptText("ABC-DEF-123-321");
            
            global::Cafe.Properties.Settings.Default.Save();
#endif
            ketnoi.CheckKey();
            if (ketnoi.KiemTraKetNoi())
            {
                Application.Run(new FrmMain());

            } 
        }
    }
}